<?php
namespace Forms\Validator;

use Pinenut\Form\Validator;

class NotEmptyAction extends Validator
{
	protected $defaultErrorMessage = 'Empty value';

	protected function isValid($value, $params)
	{
		if (is_array($value)) {
			return array_filter($value) !== array();
		} else {
			return !!strlen(trim((string)$value));
		}
	}
}